/*******************************************************************************
 * Copyright (c) 2010 Sylvain Sicard.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Lesser Public License v2.1
 * which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 * 
 * Contributors:
 *     Sylvain Sicard - initial API and implementation
 ******************************************************************************/
package asmifer;

import java.text.MessageFormat;
import java.util.HashMap;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @author Sylvain Sicard
 *
 */
public class TestTypes {
	
	int int_(){
		return 0;
	}
	short short_(){
		return 0;
	}
	char char_(){
		return ' ';
	}
	long long_(){
		return 0;
	}
	float float_(){
		return 0;
	}
	double double_(){
		return 0;
	}
	boolean boolean_(){
		return true;
	}
	
	void test(){
		int_();
		long_();
		float_();
		double_();
		boolean_();
		short_();
		char_();
	}
	
	
	public static void main(String[] args){
		Map<String, String> map = new HashMap<String, String>();
		map.put("fr\\.ssd\\.a\\.(.*)A", "fr.ssd.b.{0}B");
		
		String className = "fr.ssd.a.PeopleA";
		
		for(String k : map.keySet()){
			Pattern pattern = Pattern.compile(k);
			Matcher m = pattern.matcher(className);
			if(m.find()){
				System.out.println(className+" match "+k);
				String g1 = m.group(1);
				System.out.println(new MessageFormat(map.get(k)).format(new Object[]{g1}));
			}else{
				System.out.println(className+" don't match "+k);
			}
		}
		
	}

}
